import 'package:flutter/material.dart';

class MsgItem extends StatefulWidget {
  const MsgItem({super.key});

  @override
  State<MsgItem> createState() => _MsgItemState();
}

class _MsgItemState extends State<MsgItem> {
  @override
  Widget build(BuildContext context) {
    return Padding(
        padding: const EdgeInsets.all(10),
        child: Row(
          children: [
            Padding(
              padding: const EdgeInsets.only(right: 10, left: 0),
              child:
                  Image.asset('images/avater.png', width: 60.0, height: 60.0),
            ),
            Expanded(
                child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Padding(
                  padding: const EdgeInsets.only(bottom: 8),
                  child: Row(
                    children: [
                      const Expanded(
                          child: Text(
                        '淘气林',
                        overflow: TextOverflow.ellipsis,
                      )),
                      Container(
                        margin: const EdgeInsets.only(left: 20),
                        child: const Text('1月5日'),
                      )
                    ],
                  ),
                ),
                Row(
                  children: [
                    Expanded(
                      child: Text('开工了' * 40,
                          maxLines: 1, overflow: TextOverflow.ellipsis),
                    ),
                    Container(
                      margin: const EdgeInsets.only(left: 20),
                      child: DecoratedBox(
                        decoration: BoxDecoration(
                            color: const Color(0xFFF84D31),
                            // gradient: LinearGradient(colors: [
                            //   Colors.red,
                            //   Colors.orange.shade700
                            // ]), //背景渐变
                            borderRadius: BorderRadius.circular(20)),
                        child: const Padding(
                          padding:
                              EdgeInsets.symmetric(vertical: 0, horizontal: 5),
                          child: Text(
                            '999+',
                            style: TextStyle(color: Colors.white),
                          ),
                        ),
                      ),
                    )
                  ],
                )
              ],
            )),
          ],
        ));
  }
}
